#include "gtktypebuiltins.h"
#include "gtkdialogprivate.h"
#include "gtkstylecontextprivate.h"
+#include "gtkwidgetprivate.h"
/**
GtkPrintUnixDialogPrivate *priv;
GtkTreeSortable *sort;
GtkWidget *widget;
+ GtkCssNode *widget_node;
dialog->priv = gtk_print_unix_dialog_get_instance_private (dialog);
priv = dialog->priv;
/* Load custom papers */
_gtk_print_load_custom_papers (priv->custom_paper_list);
+
+ gtk_css_node_set_name (gtk_widget_get_css_node (priv->collate_image), I_("paper"));
}
static void
context = gtk_widget_get_style_context (widget);
- gtk_style_context_save_named (context, "paper");
-
gtk_render_background (context, cr, x, y, width, height);
gtk_render_frame (context, cr, x, y, width, height);
cairo_set_font_size (cr, 9);
cairo_move_to (cr, x + text_x, y + text_y);
cairo_show_text (cr, text);
-
- gtk_style_context_restore (context);
}
static gboolean
paint_page (widget, cr, x2 + p1, y, reverse ? "1" : "2", text_x);
paint_page (widget, cr, x2 + p2, y + 10, collate == reverse ? "2" : "1", text_x);
- }
+ }
return TRUE;
}
gdouble pos_x, pos_y;
gint pages_per_sheet;
gboolean ltr = TRUE;
- GtkStateFlags state;
orientation = gtk_page_setup_get_orientation (priv->page_setup);
landscape =
number_up_layout = dialog_get_number_up_layout (dialog);
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
- state = gtk_widget_get_state_flags (widget);
cairo_save (cr);
}
context = gtk_widget_get_style_context (widget);
-
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_PAPER);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &color);
pos_x = (width - w) / 2;
pos_y = (height - h) / 2 - 10;
shadow_offset = 3;
- gtk_style_context_get_color (context, state, &color);
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 0.5);
cairo_rectangle (cr, shadow_offset + 1, shadow_offset + 1, w, h);
cairo_fill (cr);
cairo_set_line_width (cr, 1.0);
cairo_rectangle (cr, 0.5, 0.5, w + 1, h + 1);
- gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_stroke (cr);
cairo_translate (cr, pos_x + w + shadow_offset + 2 * RULER_DISTANCE,
(height - layout_h / PANGO_SCALE) / 2);
- gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
pango_cairo_show_layout (cr, layout);
cairo_translate (cr, (width - layout_w / PANGO_SCALE) / 2,
pos_y + h + shadow_offset + 2 * RULER_DISTANCE);
- gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
pango_cairo_show_layout (cr, layout);
cairo_set_line_width (cr, 1);
- gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
if (ltr)
cairo_stroke (cr);
}
- gtk_style_context_restore (context);
-
return TRUE;
}